-
Notifications
You must be signed in to change notification settings - Fork 733
perf: better cache sharing in isDefEq
#8294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Mathlib CI status (docs):
|
| if (← read).inTypeClassResolution then | ||
| -- See comment at `inTypeClassResolution` | ||
| pure (i == j && m == n) <&&> Meta.isExprDefEqAux t s | ||
| pure (i == j && m == n) <&&> checkpointDefEq (Meta.isExprDefEqAux t s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about the effect of just these changes in isDefEqProj on Mathlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just doing this change may cause a slight slowdown, because checkPointDefEq resets the transitive defEq cache. So the cache will be reset more often. I think it will work better as a fix done simultaneously with this the fix from this PR.
But I might be wrong, so feel free to try it.
…to the previous value
This PR has moved to #8883
However, the effect of this change is better seen in mathlib, which has many complicated definitions, where the exponent in the exponential slowness can often get too big.
The mathlib benchmark shows
Zulip#lean4 > Exponential blowup in unification with metavariables @ 💬